import $http from '@/utils/http'

export const login = (data) =>
  $http.post({
    url: '/oauth/login',
    data
  })

export const getList = (params) =>
  $http.get({
    url: '/list/getList',
    params
  })

export const addItem = (data) =>
  $http.post({
    url: '/list/addItem',
    data
  })

export const changeItem = (data) =>
  $http.put({
    url: '/list/changeItem',
    data
  })

export const deleteItem = (params) =>
  $http.delete({
    url: '/list/deleteItem',
    params
  })

export const upload = (data) => {
  console.log('upload >>> ', data)
  return $http.uploadFile({
    url: '/file/upload',
    data
  })
}
